﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FindPrimeFactor
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("请输入一个大于2的数：");
            int num = int.Parse(Console.ReadLine());
            int num2 = (int)Math.Sqrt(num);
            Console.WriteLine("该数的质数因子为：");

            int detval = 2, inc = 1;
            for (; detval <= num2; detval += inc)
            {
                while (num % detval == 0)
                {
                    Console.Write(detval);
                    Console.Write("\t");
                    num /= detval;
                }
                if (detval == 3) inc = 2;
            }
            if (num != 1) Console.WriteLine(num);
            Console.ReadKey();
        }
    }
}